import request from "@/utils/request";
import { url } from "inspector";

interface requestData{
count: string;
  code?:string
  data?:any
  msg?:string
}

// 获取排班数据渲染
export function getscheduleList(params: any) {
  return request.get<requestData,requestData>("/kaoqin/schedule", { params });
}


//排班删除
export function delschedule(params: any) {
  return request<requestData,requestData>({
    url: '/schedule/delete',
    method: 'delete',
    params:params
})
}



// 获取当月排班flag数据渲染
export function getschedulemonth(params: any) {
  return request.get<requestData,requestData>("/schedule/month", { params });
}

// 获取当周排班flag数据渲染
export function getschedulWeek(params: any) {
  return request.get<requestData,requestData>("/kaoqin/shopschedule", { params });
}


// 保存按钮,提交用户个人数据
export function unbdatascheduleList(params: any) {
  return request.post<requestData,requestData>("/kaoqin/schedule",  params );
}

// 提交按钮,提交当天数据
export function putscheduleList(params: any) {
  return request.put<requestData,requestData>("/kaoqin/schedule",  params );
}


// 保存按钮,提交用户个人数据
export function posttransfer(params: any) {
  return request.post<requestData,requestData>("/kaoqin/transfer",  params );
}


// 保存按钮,提交用户个人数据
export function vacationpost(params: any) {
  return request.post<requestData,requestData>("/kaoqin/balance",  params );
}



//删除当周数据
export function deleteransfer(params: any) {
  return request<requestData,requestData>({
      url: '/kaoqin/schedule',
      method: 'delete',
      data:params
  })
}



//排班审批的查询
export function getscheduleapprove(data:any) {
  return request<requestData,requestData>({
    url:"/schedule/approve",
    method:"get",
    params:data
  })
}


//补种剩余数额
export function getKaoqinJiaban(data:any) {
  return request<requestData,requestData>({
    url:"/kaoqin/jiaban",
    method:"get",
    params:data
  })
}
